#! /usr/bin/env python2
# -*- coding: utf-8 -*-
import rospy
from geometry_msgs.msg import Twist

 
def displayWebcam():
    #创立节点
    rospy.init_node('play_turtle', anonymous=True)
    
    #订阅usb_cam发出的图像消息，接收到消息后进入回调函数callback()
    pub = rospy.Publisher('/turtle1/cmd_vel', Twist,queue_size=10000)#等待
    
    rate = rospy.Rate(10)
    msg = Twist()
    msg.linear.x = 1.0
    msg.linear.y = 0.0
    msg.linear.z = 0.0
    msg.angular.x = 0.0
    msg.angular.y = 0.0
    msg.angular.z = 0.5

    while not rospy.is_shutdown():
        pub.publish(msg)
        rate.sleep()
 
if __name__ == '__main__':
    displayWebcam()
